package com.zhong.subject.common.enums;

import lombok.Getter;

@Getter
public enum ResultCodesEnum {
    SUCCESS(200,"成功"),
    FAIL(500,"失败");
    public  Integer code;
    public String desc;
    ResultCodesEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public static ResultCodesEnum getByCode(Integer codeVal){
        for (ResultCodesEnum resultCodesEnum : ResultCodesEnum.values()) {
            if(resultCodesEnum.code.intValue() == codeVal.intValue()){
                return resultCodesEnum;
            }
        }
        return null;
    }
}
